/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package interfaz;

import java.awt.Color;
import java.awt.Dimension;
import java.util.Calendar;
import javax.swing.JInternalFrame;
import javax.swing.UIManager;

public class menu extends javax.swing.JFrame {

    int cont = 0;
    java.util.Calendar calendario;
    int dia, mes, año, hora, minutos, segundos;
    InterfazUsuarios IntUser;
    interfazLogueo Intlogueo;
    InterfazRopa IntRop;
    InterfazAccesorio IntAcc;
    intefarUso Intuso;
    public int estado;
    public String usernombre;
    public String usercedula;
    Color color = new Color(153, 153, 255);
    private BuscadoDardeBaja intdardebaja;
    private BuscarLavenderia buscarlavanderia;
    private BuscadorPrenda buscadorPrenda;
    private calificadorRopa calificarRopa;
    BuscadorConjunto buscadorConjunto;
    Cronometro cronometro;

    public menu() {
        initComponents();
        cronometro = new Cronometro(lfecha2);
        cronometro.iniciar();
        this.setExtendedState(MAXIMIZED_BOTH);
        //reloj();
        try {
            UIManager.setLookAndFeel("com.seaglasslookandfeel.SeaGlassLookAndFeel");
        } catch (Exception e) {
            e.printStackTrace();
        }
       bloquar(false);
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jToolBar1 = new javax.swing.JToolBar();
        jbUser = new javax.swing.JButton();
        bPrendas = new javax.swing.JButton();
        bAccesorios = new javax.swing.JButton();
        escritorio = new javax.swing.JDesktopPane();
        jToolBar2 = new javax.swing.JToolBar();
        jXTaskPane1 = new org.jdesktop.swingx.JXTaskPane();
        bguardar = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        bnuevo = new javax.swing.JLabel();
        jSeparator2 = new javax.swing.JSeparator();
        bmodificar = new javax.swing.JLabel();
        jSeparator3 = new javax.swing.JSeparator();
        beleminar = new javax.swing.JLabel();
        jSeparator5 = new javax.swing.JSeparator();
        bncerrar = new javax.swing.JLabel();
        jblogueo1 = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jSeparator6 = new javax.swing.JSeparator();
        lfecha1 = new javax.swing.JLabel();
        badministrador1 = new javax.swing.JLabel();
        bvendedor3 = new javax.swing.JLabel();
        lbnombre1 = new javax.swing.JLabel();
        jSeparator7 = new javax.swing.JSeparator();
        lfecha2 = new javax.swing.JLabel();
        jToolBar3 = new javax.swing.JToolBar();
        jbdardebaja = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();
        bBuscarPrenda = new javax.swing.JButton();
        buscarconjunto = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jToolBar1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Ingresos", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Arial", 0, 10), new java.awt.Color(0, 51, 255))); // NOI18N
        jToolBar1.setFloatable(false);
        jToolBar1.setRollover(true);

        jbUser.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/User1.png"))); // NOI18N
        jbUser.setText("   Usuario   ");
        jbUser.setFocusable(false);
        jbUser.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jbUser.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jbUser.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbUserActionPerformed(evt);
            }
        });
        jToolBar1.add(jbUser);

        bPrendas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/brick1.png"))); // NOI18N
        bPrendas.setText("Prendas");
        bPrendas.setFocusable(false);
        bPrendas.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        bPrendas.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        bPrendas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bPrendasActionPerformed(evt);
            }
        });
        jToolBar1.add(bPrendas);

        bAccesorios.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/briefcase.png"))); // NOI18N
        bAccesorios.setText("Accesorios");
        bAccesorios.setFocusable(false);
        bAccesorios.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        bAccesorios.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        bAccesorios.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bAccesoriosActionPerformed(evt);
            }
        });
        jToolBar1.add(bAccesorios);

        jToolBar2.setFloatable(false);
        jToolBar2.setRollover(true);

        jXTaskPane1.setAnimated(false);
        jXTaskPane1.setDoubleBuffered(false);
        jXTaskPane1.setEnabled(false);
        jXTaskPane1.setFocusTraversalPolicyProvider(true);
        jXTaskPane1.setSpecial(true);
        jXTaskPane1.setTitle("Herramientas");
        jXTaskPane1.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseMoved(java.awt.event.MouseEvent evt) {
                jXTaskPane1MouseMoved(evt);
            }
        });

        bguardar.setBackground(javax.swing.UIManager.getDefaults().getColor("ComboBox.selectionBackground"));
        bguardar.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        bguardar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/disk.png"))); // NOI18N
        bguardar.setText("Guardar");
        bguardar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        bguardar.setOpaque(true);
        bguardar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        bguardar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                bguardarMouseClicked(evt);
            }
        });
        bguardar.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseMoved(java.awt.event.MouseEvent evt) {
                bguardarMouseMoved(evt);
            }
        });
        jXTaskPane1.add(bguardar);
        jXTaskPane1.add(jSeparator1);

        bnuevo.setBackground(javax.swing.UIManager.getDefaults().getColor("Button.darkShadow"));
        bnuevo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        bnuevo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/page.png"))); // NOI18N
        bnuevo.setText("Nuevo");
        bnuevo.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        bnuevo.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        bnuevo.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                bnuevoMouseClicked(evt);
            }
        });
        bnuevo.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseMoved(java.awt.event.MouseEvent evt) {
                bnuevoMouseMoved(evt);
            }
        });
        jXTaskPane1.add(bnuevo);
        jXTaskPane1.add(jSeparator2);

        bmodificar.setBackground(new java.awt.Color(51, 153, 255));
        bmodificar.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        bmodificar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/page_white_edit.png"))); // NOI18N
        bmodificar.setText("Modificar");
        bmodificar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        bmodificar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        bmodificar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                bmodificarMouseClicked(evt);
            }
        });
        bmodificar.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseMoved(java.awt.event.MouseEvent evt) {
                bmodificarMouseMoved(evt);
            }
        });
        jXTaskPane1.add(bmodificar);
        jXTaskPane1.add(jSeparator3);

        beleminar.setBackground(new java.awt.Color(51, 153, 255));
        beleminar.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        beleminar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/delete.png"))); // NOI18N
        beleminar.setText("Eliminar");
        beleminar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        beleminar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        beleminar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                beleminarMouseClicked(evt);
            }
        });
        beleminar.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseMoved(java.awt.event.MouseEvent evt) {
                beleminarMouseMoved(evt);
            }
        });
        jXTaskPane1.add(beleminar);
        jXTaskPane1.add(jSeparator5);

        bncerrar.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        bncerrar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cancel.png"))); // NOI18N
        bncerrar.setText("Cerrar");
        bncerrar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        bncerrar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        bncerrar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                bncerrarMouseClicked(evt);
            }
        });
        bncerrar.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseMoved(java.awt.event.MouseEvent evt) {
                bncerrarMouseMoved(evt);
            }
        });
        jXTaskPane1.add(bncerrar);

        jblogueo1.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
        jblogueo1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/status_offline.png"))); // NOI18N
        jblogueo1.setText("   Entrar   ");
        jblogueo1.setFocusable(false);
        jblogueo1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jblogueo1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jblogueo1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jblogueo1ActionPerformed(evt);
            }
        });

        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jSeparator6.setOrientation(javax.swing.SwingConstants.VERTICAL);

        lfecha1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        lfecha1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/calendar.png"))); // NOI18N
        lfecha1.setText("25 de Junio del 2013");

        badministrador1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/status_offline.png"))); // NOI18N
        badministrador1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                badministrador1MouseClicked(evt);
            }
        });

        bvendedor3.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        bvendedor3.setForeground(new java.awt.Color(102, 102, 255));
        bvendedor3.setText("Nombre:");
        bvendedor3.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                bvendedor3MouseClicked(evt);
            }
        });

        lbnombre1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        lbnombre1.setText("None");

        jSeparator7.setOrientation(javax.swing.SwingConstants.VERTICAL);

        lfecha2.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        lfecha2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/clock_.png"))); // NOI18N
        lfecha2.setText("10:50");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(badministrador1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(bvendedor3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lbnombre1, javax.swing.GroupLayout.PREFERRED_SIZE, 297, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jSeparator6, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lfecha1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 334, Short.MAX_VALUE)
                .addComponent(jSeparator7, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(lfecha2, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSeparator6)
            .addComponent(lfecha1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(badministrador1)
            .addComponent(bvendedor3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(lbnombre1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jSeparator7)
            .addComponent(lfecha2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        jToolBar3.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Buscadores", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Arial", 0, 10), new java.awt.Color(51, 51, 255))); // NOI18N
        jToolBar3.setFloatable(false);
        jToolBar3.setRollover(true);

        jbdardebaja.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/basket_go.png"))); // NOI18N
        jbdardebaja.setText("Dar de Baja");
        jbdardebaja.setFocusable(false);
        jbdardebaja.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jbdardebaja.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jbdardebaja.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jbdardebajaMouseClicked(evt);
            }
        });
        jbdardebaja.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbdardebajaActionPerformed(evt);
            }
        });
        jToolBar3.add(jbdardebaja);

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/box.png"))); // NOI18N
        jButton1.setText("Buscar Lavanderia");
        jButton1.setFocusable(false);
        jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        jToolBar3.add(jButton1);

        bBuscarPrenda.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cart_go.png"))); // NOI18N
        bBuscarPrenda.setText("buscar prenda");
        bBuscarPrenda.setFocusable(false);
        bBuscarPrenda.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        bBuscarPrenda.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        bBuscarPrenda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bBuscarPrendaActionPerformed(evt);
            }
        });
        jToolBar3.add(bBuscarPrenda);

        buscarconjunto.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/package.png"))); // NOI18N
        buscarconjunto.setText("Buscador Conjunto");
        buscarconjunto.setFocusable(false);
        buscarconjunto.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        buscarconjunto.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        buscarconjunto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buscarconjuntoActionPerformed(evt);
            }
        });
        jToolBar3.add(buscarconjunto);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 299, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jToolBar3, javax.swing.GroupLayout.PREFERRED_SIZE, 440, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jblogueo1))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jXTaskPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(escritorio))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jToolBar2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jToolBar2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(559, 559, 559))
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jblogueo1))
                    .addComponent(jToolBar3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(escritorio, javax.swing.GroupLayout.PREFERRED_SIZE, 560, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(7, 7, 7))
                    .addComponent(jXTaskPane1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(25, 25, 25))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jbUserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbUserActionPerformed
        estado = 1;
        IntUser = new InterfazUsuarios();
        escritorio.add(IntUser);
        centerJIF(IntUser);

    }//GEN-LAST:event_jbUserActionPerformed

    private void jblogueo1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jblogueo1ActionPerformed
        if (cont == 0) {//cuando quiere iniciaR SECION

            iniciarLogeo();
            cont = 1;
        } else {//CUANDO quiere salir
            cerrarVentanas();
            cont = 0;
             bloquar(false);
            Intlogueo.dispose();
        }
    }//GEN-LAST:event_jblogueo1ActionPerformed
    public void cerrarVentanas() {
//        buscarlavanderia.dispose();
//        IntAcc.dispose();
//        IntRop.dispose();
//        Intuso.dispose();
//        IntUser.dispose();
    }
    private void bguardarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bguardarMouseClicked
        if (estado == 1) {
            IntUser.Grabar();

        } else if (estado == 2) {
            IntRop.Grabar();
        } else if (estado == 3) {
            IntAcc.Grabar();
        } else if (estado == 4) {
        } else if (estado == 5) {
        }
    }//GEN-LAST:event_bguardarMouseClicked

    private void bguardarMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bguardarMouseMoved
        bguardar.setBackground(color);
        bguardar.setOpaque(true);        // TODO add your handling code here:
    }//GEN-LAST:event_bguardarMouseMoved

    private void bnuevoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bnuevoMouseClicked

        if (estado == 1) {
            IntUser.nuevo();
        } else if (estado == 2) {
        } else if (estado == 4) {
            //            vProductoProveedor.nuevo();
        } else if (estado == 5) {
        }
    }//GEN-LAST:event_bnuevoMouseClicked

    private void bnuevoMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bnuevoMouseMoved
        bnuevo.setBackground(color);
        bnuevo.setOpaque(true);
    }//GEN-LAST:event_bnuevoMouseMoved

    private void bmodificarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bmodificarMouseClicked
        if (estado == 1) {
        } else if (estado == 2) {
        }
    }//GEN-LAST:event_bmodificarMouseClicked

    private void bmodificarMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bmodificarMouseMoved

        bmodificar.setBackground(color);
        bmodificar.setOpaque(true);
    }//GEN-LAST:event_bmodificarMouseMoved

    private void beleminarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_beleminarMouseClicked
        if (estado == 1) {
        } else if (estado == 2) {
        }
    }//GEN-LAST:event_beleminarMouseClicked

    private void beleminarMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_beleminarMouseMoved
        // TODO add your handling code here:
        beleminar.setBackground(color);
        beleminar.setOpaque(true);
    }//GEN-LAST:event_beleminarMouseMoved

    private void bncerrarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bncerrarMouseClicked
        if (estado == 1) {
        } else if (estado == 2) {
        } else if (estado == 4) {
        } else if (estado == 5) {
        }

    }//GEN-LAST:event_bncerrarMouseClicked

    private void bncerrarMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bncerrarMouseMoved
        bncerrar.setBackground(color);
        bncerrar.setOpaque(true);
    }//GEN-LAST:event_bncerrarMouseMoved

    private void jXTaskPane1MouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jXTaskPane1MouseMoved
        // TODO add your handling code here:
        inicializarBotones();
    }//GEN-LAST:event_jXTaskPane1MouseMoved

    private void bPrendasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bPrendasActionPerformed
        estado = 2;
        IntRop = new InterfazRopa();
        escritorio.add(IntRop);
        centerJIF(IntRop);

        // TODO add your handling code here:
    }//GEN-LAST:event_bPrendasActionPerformed

    private void bAccesoriosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bAccesoriosActionPerformed
        estado = 3;
        IntAcc = new InterfazAccesorio();
        escritorio.add(IntAcc);
        centerJIF(IntAcc);
        // TODO add your handling code here:
    }//GEN-LAST:event_bAccesoriosActionPerformed

    private void badministrador1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_badministrador1MouseClicked
    }//GEN-LAST:event_badministrador1MouseClicked

    private void bvendedor3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bvendedor3MouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_bvendedor3MouseClicked

    private void jbdardebajaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbdardebajaActionPerformed
        intdardebaja = new BuscadoDardeBaja();
        estado = 6;
        escritorio.add(intdardebaja);
        centerJIF(intdardebaja);

    }//GEN-LAST:event_jbdardebajaActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        estado = 7;
        buscarlavanderia = new BuscarLavenderia();
        escritorio.add(buscarlavanderia);
        centerJIF(buscarlavanderia);
    }//GEN-LAST:event_jButton1ActionPerformed

    private void bBuscarPrendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bBuscarPrendaActionPerformed
        estado = 5;
        buscadorPrenda = new BuscadorPrenda(this);
        escritorio.add(buscadorPrenda);
        centerJIF(buscadorPrenda);
        // TODO add your handling code here:
    }//GEN-LAST:event_bBuscarPrendaActionPerformed

    private void jbdardebajaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbdardebajaMouseClicked
    }//GEN-LAST:event_jbdardebajaMouseClicked

    private void buscarconjuntoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buscarconjuntoActionPerformed
        estado = 10;
        buscadorConjunto= new BuscadorConjunto(); 
        escritorio.add(buscadorConjunto);
        centerJIF(buscadorConjunto);
    }//GEN-LAST:event_buscarconjuntoActionPerformed

    public void iniciarLogeo() {
        Intlogueo = new interfazLogueo(this);
        escritorio.add(Intlogueo);
        centerJIF(Intlogueo);
    }

    public void inicializarBotones() {
        bguardar.setBackground(Color.red);
        bnuevo.setBackground(Color.red);
        bmodificar.setBackground(Color.red);
        beleminar.setBackground(Color.red);
        bncerrar.setBackground(Color.red);
        bguardar.setOpaque(false);
        bnuevo.setOpaque(false);
        bmodificar.setOpaque(false);
        beleminar.setOpaque(false);
        bncerrar.setOpaque(false);

    }

    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */

        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                menu menu = new menu();
                menu.setVisible(true);
                menu.setLocationRelativeTo(null);
                menu.setDefaultCloseOperation(menu.EXIT_ON_CLOSE);
                menu.setVisible(true);
            }
        });
    }
    public void bloquar(boolean f){
        bAccesorios.setEnabled(f);
        bBuscarPrenda.setEnabled(f);
        bPrendas.setEnabled(f);
        beleminar.setEnabled(f);
        bguardar.setEnabled(f);
        bmodificar.setEnabled(f);
        bnuevo.setEnabled(f);
        buscarconjunto.setEnabled(f);
        jbdardebaja.setEnabled(f);
        jButton1.setEnabled(f);
        jbUser.setEnabled(f);
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bAccesorios;
    private javax.swing.JButton bBuscarPrenda;
    private javax.swing.JButton bPrendas;
    private javax.swing.JLabel badministrador1;
    private javax.swing.JLabel beleminar;
    private javax.swing.JLabel bguardar;
    private javax.swing.JLabel bmodificar;
    private javax.swing.JLabel bncerrar;
    private javax.swing.JLabel bnuevo;
    private javax.swing.JButton buscarconjunto;
    private javax.swing.JLabel bvendedor3;
    public javax.swing.JDesktopPane escritorio;
    private javax.swing.JButton jButton1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JSeparator jSeparator5;
    private javax.swing.JSeparator jSeparator6;
    private javax.swing.JSeparator jSeparator7;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JToolBar jToolBar2;
    private javax.swing.JToolBar jToolBar3;
    private org.jdesktop.swingx.JXTaskPane jXTaskPane1;
    private javax.swing.JButton jbUser;
    private javax.swing.JButton jbdardebaja;
    private javax.swing.JButton jblogueo1;
    public javax.swing.JLabel lbnombre1;
    private javax.swing.JLabel lfecha1;
    private javax.swing.JLabel lfecha2;
    // End of variables declaration//GEN-END:variables

    public void cargarUsuario(String nombre, String fecha1, String cedula) {
        lbnombre1.setText(nombre);
        lfecha1.setText(fecha1);
        this.usercedula = cedula;
        this.usernombre = nombre;
        
    }

    private void reloj() {
        calendario = new java.util.GregorianCalendar();
        segundos = calendario.get(Calendar.SECOND);
        javax.swing.Timer timer = new javax.swing.Timer(1000, new java.awt.event.ActionListener() {
            @ Override
            public void actionPerformed(java.awt.event.ActionEvent ae) {
                java.util.Date actual = new java.util.Date();
                calendario.setTime(actual);
                dia = calendario.get(Calendar.DAY_OF_MONTH);
                mes = (calendario.get(Calendar.MONTH) + 1);
                año = calendario.get(Calendar.YEAR);
                hora = calendario.get(Calendar.HOUR_OF_DAY);
                minutos = calendario.get(Calendar.MINUTE);
                segundos = calendario.get(Calendar.SECOND);
                String hour = String.format("%02d : %02d : %02d", hora, minutos, segundos);
                String date = String.format("%02d / %02d / %02d", dia, mes, año);
                lfecha2.setText(hour);
            }
        });
        timer.start();
    }

    public void centerJIF(JInternalFrame jif) {
        Dimension desktopSize = escritorio.getSize();
        Dimension jInternalFrameSize = jif.getSize();
        int width = (desktopSize.width - jInternalFrameSize.width) / 2;
        int height = (desktopSize.height - jInternalFrameSize.height) / 2;
        jif.setLocation(width, height);
        jif.setVisible(true);
    }
}
